import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by 14229 on 2020/2/21.
 */
public class Test05 {
    public static void main(String[] args) throws IOException {

        Map<String, String> jiexi = jiexi("a.txt");
        for (String s : jiexi.keySet()) {
            System.out.print(jiexi.get(s)+"  ");
        }
    }
    public static Map<String,String> jiexi(String s) throws IOException {
        Map<String,String> map = new HashMap<>();
//代码填充

        List<String> lines = FileUtils.readLines(new File(s), "UTF-8");
        for (String line : lines) {
            String[] split = line.replace("{", "").replace("}", "").replace("'", "").split(",");
            for (String s1 : split) {
                String[] split1 = s1.split(":");
                map.put(split1[0],split1[1]);
            }
        }
        return map;

    }
}
